<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

  <title>diffHTML Demo</title>
</head>

<body>
  <main></main>
  <footer></footer>

  <script src="../node_modules/diffhtml/dist/diffhtml.js"></script>
  <script src="../../diffhtml-middleware-logger/dist/logger.js"></script>
  <script>
    const { use, html, innerHTML, outerHTML } = diff;

    use(logger());

    const render = () => {
      innerHTML(document.querySelector('main'), html`
        <div id="test">
          <span>Current date: </span>
          <span>${new Date().toLocaleString()}</span>

          <p>
            <button onClick=${render}>Re-render</button>
          </p>
        </div>
      `)

      outerHTML(document.querySelector('footer'), html`<footer id="footer">
          Testing out footer
      </footer>`);

      return render;
    };

    render();
  </script>
</body>
</html>
